import 'package:flutter_oldman_health/models/response_data_model.dart';

class DistanceLimitModel extends ResponseDataModel<List<DistanceLimitItem>> {
  DistanceLimitModel({int code, List<DistanceLimitItem> data, String msg})
      : super(code: code, data: data, msg: msg);

  factory DistanceLimitModel.fromJson(Map<String, dynamic> json) {
    var data = json["data"] as List;
    print(data);
    return DistanceLimitModel(
        code: json["code"],
        data: data.map((e) => DistanceLimitItem.fromJson(e)).toList(),
        msg: json["msg"]);
  }
}

class DistanceLimitItem {
  String id;
  String limitedId;
  double longitude;
  double latitude;
  int distance;
  int remind;

  DistanceLimitItem(
      {this.id,
      this.limitedId,
      this.longitude,
      this.latitude,
      this.distance,
      this.remind});

  factory DistanceLimitItem.fromJson(Map<String, dynamic> json) {
    return DistanceLimitItem(
        id: json["id"],
        limitedId: json["limitedId"],
        longitude: json["longitude"],
        latitude: json["latitude"],
        distance: json["distance"],
        remind: json["remind"]);
  }
}
